<!DOCTYPE html>

<html
<head>
    <title>Simple 3D example</title>
    <style>
    div {
        height: 150px;
        width: 150px;
    }
    .scene {
        border: 1px solid black;
        margin: 20px;
        padding: 10px;
        background-color: rgba(0, 0, 0, 0.3);
        -webkit-perspective: 500px;
        -moz-perspective: 500px;
        -ms-perspective: 500px;
        -o-perspective: 500px;
        perspective: 500px;
    }
    .container {
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        -ms-transform-style: preserve-3d;
        -o-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }

    .container > div {
        position: absolute;
        left: 0;
    }
    .container > :first-child {
        -webkit-transform: rotateY(45deg);
        -moz-transform: rotateY(45deg);
        -ms-transform: rotateY(45deg);
        -o-transform: rotateY(45deg);
        transform: rotateY(45deg);
        background-color: orange;
        top: 10px;
        height: 135px;
    }

    .container > :last-child {
        -webkit-transform: translateZ(40px);
        -moz-transform: translateZ(40px);
        -ms-transform: translateZ(40px);
        -o-transform: translateZ(40px);
        transform: translateZ(40px);
        background-color: rgba(0, 0, 255, 0.75);
        top: 50px;
        height: 100px;
    }
    </style>
</head>
<body>
  <div class="scene">
    <div class="container">
      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam.
      <div></div>
      <div></div>
    </div>
  </div>
</body>
</html>
